package com.sendpo.zjx.sendpo.glide;

import android.content.Context;

import com.bumptech.glide.Glide;
import com.bumptech.glide.GlideBuilder;
import com.bumptech.glide.load.DecodeFormat;
import com.bumptech.glide.load.engine.cache.DiskLruCacheFactory;
import com.bumptech.glide.module.GlideModule;

/**
 * Created by 朱俊鑫 on 2017/4/24.
 */

public class GlideCache implements GlideModule {
    @Override
    public void applyOptions(Context context, GlideBuilder builder) {
         builder.setDecodeFormat(DecodeFormat.PREFER_ARGB_8888);
         builder.setDiskCache(new DiskLruCacheFactory(context.getExternalCacheDir().getAbsolutePath()+"/image",50*1000*1000));
    }

    @Override
    public void registerComponents(Context context, Glide glide) {

    }

}
